home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.07 Jul 90 / Commando Programming ƒ / Rezscripts / RezC.SIZE < prev    next >
Encoding:
Text File  |  1989-08-16  |  1.9 KB  |  68 lines  |  [TEXT/MPS ]

  1. ###    File RezC.SIZE
  2. ### Generates Rez input for MultiFinder/Switcher Size resource
  3. ### W. Powell  1988
  4. ### WARNING:  The size resource syntax is different with
  5. ###        different MPW versions.  By default this script
  6. ###        is set to work with MPW vers. 3.0, 
  7. ###        To change to MPW 2.02 compatability, set the following
  8. ###        shell variable "MPWSizeVers" to anything other than "3".
  9. Set MPWSizeVers "3"
  10.  
  11. Set Exit 0
  12. Set rid {1}
  13. If {rid} != -1
  14.     Alert "WARNING:  Resource ID must be -1 to be used by MultiFinder or Switcher."
  15. End
  16. Echo -n "Resource ∂'SIZE∂' ({rid}"
  17. Shift 1
  18. If "{1}" == "-nms"
  19.     Echo -n ",∂"{2}∂""
  20.     Shift 2
  21. End
  22. # Size settings in Kbyte
  23. Set Pref {1}
  24. Set Min {2}
  25. # Flags
  26. Set Op1 {3}
  27. Set Op2 {4}
  28. Set Op3 {5}
  29. Set Op4 {6}
  30. Set Op5 {7}
  31. ###########
  32. # The following was added to work with MPW version 3.0 Types.r
  33. # older MPW versions may use different symbolic constants
  34. # Change the following to match symbolic constants from the
  35. # Types.r file in your {RIncludes} directory.
  36. If ( "{7}" == "doOwnActivate" )
  37.     Set Op5 "multiFinderAware"
  38. Else If ( "{7}" == "dontDoOwnActivate" )
  39.     Set Op5 "notMultiFinderAware"
  40. End #if
  41. ###########
  42. Shift 7
  43.  
  44. # Resource attributes
  45. If ( "{1}" == "-sy" ) ; Echo -n ",SysHeap" ; Shift ; End
  46. If ( "{1}" == "-pu" ) ; Echo -n ",Purgeable" ; Shift ; End
  47. If ( "{1}" == "-lo" ) ; Echo -n ",Locked" ; Shift ; End
  48. If ( "{1}" == "-Pr" ) ; Echo -n ",Protected" ; Shift ; End
  49. If ( "{1}" == "-PL" ) ; Echo -n ",PreLoad" ; Shift ; End
  50. Echo ") ∂{"
  51.  
  52. Echo "∂t{Op1},"
  53. Echo "∂t{Op2},"
  54. Echo "∂t{Op3},"
  55. Echo "∂t{Op4},"
  56. Echo "∂t{Op5},"
  57. If ( "{MPWSizeVers}" == "3" ) # for MPW version 3.0
  58.     Echo "∂treserved, reserved, reserved, reserved,"
  59.     Echo "∂treserved, reserved, reserved, reserved,"
  60.     Echo "∂treserved, reserved, reserved,"
  61. End
  62. # Convert sizes to bytes
  63. Set Pref `Evaluate {Pref} * 1024 `
  64. Set Min `Evaluate {Min} * 1024 `
  65. Echo "∂t{Pref},∂t∂/* Preferred size, bytes *∂/"
  66. Echo "∂t{Min} ∂t∂/* Minimum size, bytes   *∂/"
  67. Echo "∂t∂};"
  68. Exit 0